package bundle2name

import org.slf4j.LoggerFactory
import us.codecraft.webmagic.ResultItems
import us.codecraft.webmagic.Task
import us.codecraft.webmagic.pipeline.Pipeline

class FilePipeline() : Pipeline {
    val Log = LoggerFactory.getLogger(javaClass)
    val file = LoggerFactory.getLogger("fileLogger")
    override fun process(r: ResultItems, task: Task?) {
        val ps :List<BundleName>? = r["ps"]
        ps?.forEach {
            file.info("${it.bundle}\t${it.name}")
        }


    }

}